import java.io.*;
import java.lang.Throwable;

public class Test13 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\java\\Hello.txt";

        try {
            FileWriter out = new FileWriter(fileName);

            out.write("java要考试了!\n");
            out.write("我要出去玩!\n");

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            System.out.println("end");
        }
    }
}
